package com.basemodel;

import io.swagger.annotations.ApiModelProperty;

/**
 * @author: cxt
 * @time: 2022/6/29
 */
public class PageParam {

    public final static int DEFAULT_PAGE_NUM = 1;
    public final static int DEFAULT_PAGE_SIZE = 10;

    @ApiModelProperty("页数")
    private Integer pageNum;

    @ApiModelProperty("页大小")
    private Integer pageSize;

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        if (pageNum <= 0) {
            pageNum = DEFAULT_PAGE_NUM;
        }
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        if (pageSize <= 0) {
            pageSize = DEFAULT_PAGE_SIZE;
        }
        this.pageSize = pageSize;
    }
}
